<template>
	<div class="shop">
    <div class="shopTodayData">
      <div>
        <p>今日奖励（元）</p>
        <p><strong>{{Public.formatMoney(agentAccountData.accountListMoneySumByToday,2)}}</strong></p>
        <span>昨日<em>{{Public.formatMoney(agentAccountData.countToday,2)}}</em></span>
      </div>
      <div>
        <p>今日付款单数</p>
        <p><strong>{{agentAccountData.accountListMoneySumByYesterday}}</strong></p>
        <span>昨日<em>{{agentAccountData.countYesterday}}</em></span>
      </div>
    </div>
    <div class="shopEntrance">
      <div v-for="(item,index) in linkEntrance" class="shopEntranceLink">
        <router-link :to="item.go_href">
          <em class="iconfont" :class="item.iconColor" v-html="item.iconPic"></em>
          <span>{{item.linkEntranceDes}}</span>
        </router-link>
      </div>
    </div>
    <vue-footer></vue-footer>
	</div>
</template>

<script>
  import { Toast } from 'mint-ui'; //引入弹框
  import vueFooter from '../../components/footer/shopMineFooter.vue'
	export default {
    components: {
      vueFooter,
    },
		data () {
			return {
        memberCode:"",    //存储上个页面的localStorage数值
        agentAccountData:{},   //初始化页面数据
        //入口集合
        linkEntrance:[
          {
            go_href:"/goodsCategory",
            iconColor:"iconColorAdd",
            iconPic: "&#xe991;",
            linkEntranceDes: "添加商品",
          },
          {
            go_href:"/shopGoodControl",
            iconColor:"iconColorShop",
            iconPic: "&#xe61d;",
            linkEntranceDes: "商品管理",
          },
          {
            go_href:"/shopBonus",
            iconColor:"iconColorGift",
            iconPic: "&#xe612;",
            linkEntranceDes: "我的奖励",
          },
          {
            go_href:'/orderList',
            iconColor:"iconColorList",
            iconPic: "&#xe6a1;",
            linkEntranceDes: "订单管理",
          },
          {
            go_href:'/shopHomePage',
            iconColor:"iconColorShow",
            iconPic: "&#xe628;",
            linkEntranceDes: "预览店铺",
          }
        ],
			}
		},
		methods:{
      //初始化页面数据
      queryInfo(){
        this.axios({
          method: 'post',
          url: "/v3/agent/accountLists/queryDataBySum",
          data: {
              "memberCode":this.memberCode,
          }
        }).then((res) => {
            this.agentAccountData = res.data.sumInfo;
        }).catch((err) => {
          Toast({
            message: err.response.data,
            iconClass: 'fontSize iconfont icon-shibai'
          });
        });
      },

		},

		mounted(){
      this.queryInfo();   //初始化页面的数据
		},

    created(){
		  //获取上个页面存储的memberCode
      this.memberCode = localStorage.getItem("memberCode");
    },

    activated() {
      document.querySelector('#vue_id_title').innerHTML="店铺名称";
    },
	}
</script>

<style scoped>
  em{
    font-style: normal;
  }
  /*shopTodayData Start*/
  .shopTodayData{
    height: 4.6rem;
    background: #fff;
    padding: 1rem 0rem 1rem;
    border-bottom: 1px solid #ddd;
  }

  .shopTodayData p{
    color: #101010;
    font-size: 14px;
    margin-bottom: .3rem;
  }
  .shopTodayData p strong{
    font-size: 24px;
  }
  .shopTodayData div{
    float: left;
    width: 50%;
    text-align: center;
  }

  .shopTodayData div span em{
    margin-left: 4px;
  }

  .shopTodayData div span{
    font-size: 12px;
  }
  /*shopTodayData End*/

  /*shopEntrance Start*/
  .shopEntrance{
    height: 5.6rem;
    background: #fff;
    margin-top: .25rem;
    padding: .5rem .6rem;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
  }
  .shopEntranceLink{
    width: 33%;
    float:left;
    margin-bottom: .5rem;
    text-align: center;
  }
  .shopEntranceLink em{
    font-size: 35px;
    margin: 0 auto .1rem;
    display: block;
    height: 1.3rem;
    width: 1.5rem;
    line-height: 0.9rem;
  }
  /*入口样式调整 Start*/
  .iconColorAdd,
  .iconColorShop,
  .iconColorShow,
  .iconColorList,
  .iconColorGift{
    padding: .2rem;
    width: 1.4rem;
    color: #fff;
    border-radius: .2rem;
  }

  .iconColorAdd{
    color: green;
    font-size: 46px!important;
    line-height: 1.1rem !important;
  }
  .iconColorShop{
    color: #d4237a;
  }
  .iconColorGift{
    color: #fbb03c;
  }
  .iconColorList{
    color: orange;
  }
  .iconColorShow{
    color: #4eb0e4;
    font-size: 49px !important;
    position: relative;
    left: -.1rem;
  }
  /*入口样式调整 End*/

  /*shopEntrance End*/

  /*shopFoot Start*/
  .shopFoot{
    position: fixed;
    bottom: 0;
    height: 1.6rem;
    width: 100%;
    color: #888;
    z-index: 100;
    box-shadow: 3px 0px 5px #ccc;
    background: #fff;
    padding-top: 0.1rem;
  }
  .shopFootNav{
    display: -webkit-box;
  }
  .shopFootNav div{
    -webkit-box-flex: 1;
    text-align: center;
    font-size: 14px;
  }

  .shopFootNav div em{
    font-size: 28px;
    display: block;
    width: 1rem;
    height: .8rem;
    margin: 0 auto;
  }

  /*底部图标样式 Start*/
  .footNavIconStore,
  .footNavIconManger{
    position: relative;
    top: -0.2rem;
    font-size: 37px !important;
  }

  .footNavIconShare{
    font-size: 24px !important;
  }

  .red{
    color: #D50B0A;
  }

  a:hover{
    color: #565656;
  }
  /*底部图标样式 End*/
  /*shopFoot End*/



</style>
